package com.wangzaiplus.test;

/**
 * @ClassName ThreadThread
 * @Description: TODO
 * @Author wgc
 * @Date 2020/06/04 10:56
 * @Version V1.0
 **/
public class ThreadThread {
    public static void main(String[] args){
       final Thread t1=new Thread(new Runnable() {
           @Override
           public void run() {

               System.out.println("--T1--");
           }
       });

        final Thread t2=new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //T1线程 等t1线程执行完
                    t1.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("--T2--");
            }
        });
        final Thread t3=new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //T2线程 等t2线程执行完
                    t2.join();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("--T3--");
            }
        });
        t3.start();
        t1.start();
        t2.start();

    }
}
